let mySet = new Set()

mySet.add(1)
mySet.add(5)
mySet.add(5)
mySet.add('some text')
mySet.add({a: 1, b: 2})
mySet.add({a: 1, b: 2})

const has = mySet.has(1)

mySet.delete(5)

for(let item of mySet) {
  console.log(item)
}
//Set转数组
const myArr = [...mySet]
const myArr2 = Array.from(mySet)
//数组转Set
const mySet2 = new Set([1,2,2,3])
